<html>
<head>
</head>
<body>
<form method=GET action="blinkctrl.php">
<input name="button" type="submit" value="on">
<input name="button" type="submit" value="off">
<input name="button" type="submit" value="no function">
</form>

<?php
	if (isset($_GET["button"]))
	{
		if ($_GET["button"] == "on")
			{
			echo  ("ON detected");
			system("sudo blink_endless.py  > /dev/null 2>&1   &"); // output is directed to /dev/null (the bin)  erreor messages the same way (2>&1)  and it runs in bg  (&)
			}
		if ($_GET["button"] == "off")
			{
			echo  ("OFF detected");
			system("sudo pkill sudo  > /dev/null 2>&1  "); // kills the blinking. output is directed to /dev/null (the bin)  erreor messages the same way (2>&1)  
			//actually kills the sudo process that started the blinking..
			}
	}
?>

</body>
<html>